#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

import os, Options

def build(bld):
    bld.add_subdirs('runtime memAnalyzer')

    obj = bld.new_task_gen('cxx', 'staticlib')
    obj.add_objects = 'loader syscall bfdFrontend tools debugger utils profiler'
    obj.name = 'trap_static'
    obj.uselib = 'BOOST_THREAD BOOST_REGEX BOOST_SYSTEM BOOST_FILESYSTEM SYSTEMC BFD'
    obj.target = 'trap'
    obj.install_path = os.path.join('${PREFIX}', 'lib')

    obj = bld.new_task_gen('cxx', 'cshlib')
    obj.add_objects = 'loader syscall bfdFrontend tools debugger utils profiler'
    obj.name = 'trap_dyn'
    obj.uselib = 'BOOST_THREAD BOOST_REGEX BOOST_SYSTEM BOOST_FILESYSTEM SYSTEMC BFD'
    obj.target = 'trap'
    obj.install_path = os.path.join('${PREFIX}', 'lib')

    obj = bld.new_task_gen('py')
    obj.find_sources_in_dirs('.', exts=['.py'])
    obj.install_path = os.path.join('${PYTHON_INSTALL_DIR}', 'trap')
